package com.java.polymorphism.test_1;

/**
 * @author luzhikun
 * @date 2020/12/5- 20:39
 */
public class Instance_Test {
    public static void main(String[] args) {
        Instance_Test instance_test = new Instance_Test();
        instance_test.method(new Student_Test1());
        System.out.println("------------------------------------");
        instance_test.method(new Graduate());
    }

    public void method(Person_Test1 e) {
        String a = e.getInfo();
        System.out.println(a);
        if (e instanceof Graduate) {
            System.out.println("你是第三个");
        } else if (e instanceof Student_Test1) {
            System.out.println("你是第二个");
        }
    }
}
